import axios from 'axios';

export function getUserList() {
    return axios('getUserList');
}

export function getUser(openID) {
    return axios.post('getUser', { openid: openID });
}

export function deleteUser(openID) {
    return axios.post('deleteUser', { openid: openID });
}

export function updateUser(openID, content) {
    let data = {
        openid: openID
    }
    for (const key in content) {
        if (Object.hasOwnProperty.call(content, key)) {
            data[key] = content[key];
        }
    }
    return axios.post('updateUser', data);
}